package com.goldgov.code.utils;

import java.util.Iterator;
import java.util.Map;

public class PlaceholderUtils {

	private PlaceholderUtils() {}
	
	public static String replace(String text,Map<String,Object> dataMap) {
		Iterator<String> iteratorKey = dataMap.keySet().iterator();
		while(iteratorKey.hasNext()){
			String key = iteratorKey.next();
			if(dataMap.get(key) != null){
				text = text.replaceAll("__"+key+"__", dataMap.get(key).toString());
			}
		}
		return text;
	}
}
